﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using CodeStash.Common.DataAccess.EntityFramework;

namespace CodeStash.Models.Snippet
{
    public class AddSnippetViewModel : ISnippetViewModel
    {
        #region Ctor
        /// <summary>
        /// For Post request where ModelBinding takes care of matching up properties for us
        /// </summary>
        public AddSnippetViewModel()
        {
            LanguageList = new List<Language>();
            VisibilityList = new List<Visibility>();

        }
        #endregion

        #region Public Properties

        public List<Language> LanguageList { get; set; }

        [Required(ErrorMessage = "You must enter a value for Language")]
        public int LanguageId { get; set; }

        public int CodeCategoryId { get; set; }


        [Required(ErrorMessage = "You must enter a value for Category")]
        public string NewCodeCategoryName { get; set; }


        public int GroupId { get; set; }


        [StringLength(100, MinimumLength = 0,
            ErrorMessage = "Grouping must be between 0-100 characters in length")]
        public string NewGroupingName { get; set; }


        [StringLength(100, MinimumLength=0,
            ErrorMessage = "Tags must be between 0-100 characters in length")]
        public string Tags { get; set; }


        [Required(ErrorMessage = "You must enter a value for Description")]
        public string Description { get; set; }


        [Required(ErrorMessage = "You must enter a value for Title")]
        public string Title { get; set; }


        [Required(ErrorMessage = "You must enter a value for ActualCode")]
        public string ActualCode { get; set; }


        public List<Visibility> VisibilityList { get; set; }

        [Required(ErrorMessage = "You must enter a value for Visibility")]
        public int Visibility { get; set; }
        

        public Guid AspNetMembershipUserId { get; set; }

        #endregion
    }

}